<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich">
<h:head>
	<title>Fiap Airport Web</title>
</h:head>
<h:body>
	<ui:include src="/cliente/menu.xhtml"/>
	<rich:panel header="Cadastro Reserva">
	
	<h:form>
		
		<c:if test="${not empty reservaBean.reserva.id}">
			<div>
				<span>Código:</span>
				<h:inputHidden value="#{reservaBean.reserva.id}" />
				<h:outputLabel value="#{reservaBean.reserva.id}" />
			</div>
		</c:if>

		<div>
			<span>Trecho:</span>
			<h:selectOneMenu value="#{reservaBean.trecho.id}" required="true">
				<f:selectItem itemValue="0" itemLabel="Selecione" />               
			    <f:selectItems value="#{reservaBean.trechos}" />
			</h:selectOneMenu>
		</div>
		<div>
			<span>Assentos Econômicos:</span>
			<h:inputText value="#{reservaBean.reserva.assentosEconomicosOcupados}" />
		</div>
		<div>
			<span>Assentos Executivos:</span>
			<h:inputText value="#{reservaBean.reserva.assentosExecutivosOcupados}" />
		</div>
		
		<div>
			<p>
				<h:commandButton action="#{reservaBean.salvarDados()}" value="Salvar" />
				<h:commandButton action="lista-reserva" value="Voltar" immediate="true" />
			</p>
		</div>
		
	</h:form>
	</rich:panel>
</h:body>
</html>
